package com.dmjj.log.service;

import com.alibaba.fastjson.JSON;
import com.dmjj.log.pojo.SysLog;
import com.dmjj.util.rabbitconfig.RabbitConfig;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;

@Service
public class LoggerService {
 
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void log(SysLog sysLog){
        rabbitTemplate.convertAndSend(RabbitConfig.ExchangeName,"testqueue", JSON.toJSONString(sysLog));
    }
}